This will be needed for lockdown, e.g. on the login screen.
https://bugzilla.gnome.org/show_bug.cgi?id=730007
<refsect2 id="interactive-debugging">
<title>Interactive debugging</title>
+ <inlinegraphic fileref="inspector.png" format="PNG"></inlinegraphic>
+
<para>
GTK+ includes an interactive debugger which lets you explore the
widget tree of any GTK+ application at runtime, as well as tweak
Control-Shift-D keyboard shortcuts, or pass set the
<envar>GTK_DEBUG=interactive</envar> environment variable.
</para>
-
- <inlinegraphic fileref="inspector.png" format="PNG"></inlinegraphic>
+ <para>
+ In some situations, it may be inappropriate to give users access
+ to the interactive debugger. The keyboard shortcuts can be disabled
+ with the `enable-inspector-keybinding` key in the `org.gtk.Settings.Debug`
+ GSettings schema.
+ </para>
</refsect2>
--source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \
mv gtkbuiltincache.h.tmp gtkbuiltincache.h
+gsettings_SCHEMAS = \
+ org.gtk.Settings.FileChooser.gschema.xml \
+ org.gtk.Settings.ColorChooser.gschema.xml \
+ org.gtk.Settings.Debug.gschema.xml
+
+@GSETTINGS_RULES@
+
EXTRA_DIST += \
$(resource_files) \
$(STOCK_ICONS) \
$(GENERATED_ICONS) \
+ $(gsettings_SCHEMAS) \
gtk-win32.rc \
gtk-win32.rc.in \
gtkwin32embed.h \
gtktypebuiltins.c.template \
gtktypebuiltins.h.template \
gtkprivatetypebuiltins.c.template \
- gtkprivatetypebuiltins.h.template \
- org.gtk.Settings.FileChooser.gschema.xml \
- org.gtk.Settings.ColorChooser.gschema.xml
-
-gsettings_SCHEMAS = \
- org.gtk.Settings.FileChooser.gschema.xml \
- org.gtk.Settings.ColorChooser.gschema.xml
-
-@GSETTINGS_RULES@
+ gtkprivatetypebuiltins.h.template
install-data-local:
gtk_widget_hide (inspector_window);
}
+static gboolean
+inspector_keybinding_enabled (void)
+{
+ GSettingsSchema *schema;
+ GSettings *settings;
+ gboolean enabled;
+
+ enabled = FALSE;
+
+ schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
+ "org.gtk.Settings.Debug",
+ FALSE);
+ if (schema)
+ {
+ settings = g_settings_new_full (schema, NULL, NULL);
+ enabled = g_settings_get_boolean (settings, "enable-inspector-keybinding");
+ g_object_unref (settings);
+ g_settings_schema_unref (schema);
+ }
+
+ return enabled;
+}
+
static void
gtk_window_toggle_debugging (GtkWindow *window)
{
- if (GTK_IS_WIDGET (inspector_window) && gtk_widget_is_visible (inspector_window))
+ if (!inspector_keybinding_enabled ())
+ return;
+
+ if (GTK_IS_WIDGET (inspector_window) &&
+ gtk_widget_is_visible (inspector_window))
gtk_window_set_interactive_debugging (FALSE);
else
gtk_window_set_interactive_debugging (TRUE);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist>
+
+ <schema id='org.gtk.Settings.Debug' path='/org/gtk/settings/debug/'>
+ <key name='enable-inspector-keybinding' type='b'>
+ <default>true</default>
+ <summary>Enable inspector keybinding</summary>
+ <description>
+ If this setting is true, GTK+ lets the user open an interactive
+ debugging window with a keybinding. The default shortcuts for
+ the keybinding are Control-Shift-I and Control-Shift-D.
+ </description>
+ </key>
+ </schema>
+
+</schemalist>
+